.class public Lcom/htc/android/footprints/service/LocationAgent;
.super Ljava/lang/Object;
.source "LocationAgent.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/htc/android/footprints/service/LocationAgent$NameAndDate;,
        Lcom/htc/android/footprints/service/LocationAgent$AgentListener;
    }
.end annotation


# static fields
.field private static final FALLBACK_PROVIDER_THRESHOLD_MILLIS:J = 0x2710L

.field private static final GPS:Ljava/lang/String; = "gps"

.field private static final HANDLER_NOTIFY_CLIENT:I = 0x68

.field private static final HANDLER_TRACKING_TIMEOUT:I = 0x64

.field private static final HANDLER_UPDATE_STATUS:I = 0x67

.field private static final HANDLER_WAIT_FOR_PAUSE:I = 0x69

.field private static final ICON_LEVEL_GPS_OFF:I = 0x6

.field private static final ICON_LEVEL_GPS_ON:I = 0x5

.field private static final ICON_LEVEL_MAP:I = 0x7

.field private static final ICON_LEVEL_NETWORK:I = 0x8

.field private static final ICON_LEVEL_SIGNAL0:I = 0x0

.field private static final ICON_LEVEL_SIGNAL1:I = 0x1

.field private static final ICON_LEVEL_SIGNAL2:I = 0x2

.field private static final ICON_LEVEL_SIGNAL3:I = 0x3

.field private static final ICON_LEVEL_SIGNAL4:I = 0x4

.field private static final LOCATION_MIS_DISTANCE:F = 0.0f

.field private static final LOCATION_UPDATE_MILLIS:J = 0x0L

.field private static final LOW_SIGNAL:I = 0x5

.field private static final MODE_FIX_GPS:I = 0xd

.field private static final MODE_FIX_NETWORK:I = 0xe

.field private static final MODE_PAUSE_STANDBY:I = 0xf

.field private static final MODE_PAUSE_WAIT_TIMEOUT:I = 0x10

.field private static final MODE_STOP:I = 0xa

.field private static final MODE_TIMEOUT:I = 0xc

.field private static final MODE_TRACKING:I = 0xb

.field private static final NETWORK:Ljava/lang/String; = "network"

.field private static PROVIDER_NAMES:[Ljava/lang/String; = null

.field private static final TAG:Ljava/lang/String; = "LocationAgent"

.field private static final TIMEOUT:J = 0x1d4c0L

.field private static final WAIT_PAUSE_TIMER:J = 0x1388L

.field private static mInstance:Lcom/htc/android/footprints/service/LocationAgent;


# instance fields
.field private gpsFixStatus:Lcom/htc/android/footprints/utils/GpsFixStatus;

.field private gpsListener:Landroid/location/GpsStatus$Listener;

.field private isTimeoutNotify:Z

.field private isTrackingAfterResume:Z

.field private mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

.field private mContext:Landroid/content/Context;

.field private mCurIcon:I

.field private mCurMode:I

.field private final mEnabledProviders:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/htc/android/footprints/service/LocationAgent$NameAndDate;",
            ">;"
        }
    .end annotation
.end field

.field private mGpsSignal:F

.field private mHandler:Landroid/os/Handler;

.field private mLocation:Landroid/location/Location;

.field private mLocationListener:Landroid/location/LocationListener;

.field private mLocationManager:Landroid/location/LocationManager;

.field private mLocationNetwork:Landroid/location/Location;

.field private mTimeout:J


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 60
    const/4 v0, 0x2

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    const-string v2, "gps"

    aput-object v2, v0, v1

    const/4 v1, 0x1

    const-string v2, "network"

    aput-object v2, v0, v1

    sput-object v0, Lcom/htc/android/footprints/service/LocationAgent;->PROVIDER_NAMES:[Ljava/lang/String;

    .line 62
    const/4 v0, 0x0

    sput-object v0, Lcom/htc/android/footprints/service/LocationAgent;->mInstance:Lcom/htc/android/footprints/service/LocationAgent;

    return-void
.end method

.method private constructor <init>(Landroid/content/Context;)V
    .locals 3
    .parameter "context"

    .prologue
    const/4 v2, 0x0

    .line 105
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 64
    iput-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mContext:Landroid/content/Context;

    .line 66
    iput-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationManager:Landroid/location/LocationManager;

    .line 68
    iput-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    .line 70
    iput-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    .line 72
    iput-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->gpsFixStatus:Lcom/htc/android/footprints/utils/GpsFixStatus;

    .line 74
    const/16 v0, 0xa

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    .line 76
    const/4 v0, 0x6

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    .line 78
    const-wide/32 v0, 0x1d4c0

    iput-wide v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mTimeout:J

    .line 80
    const/4 v0, 0x0

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    .line 82
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->isTimeoutNotify:Z

    .line 84
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->isTrackingAfterResume:Z

    .line 86
    new-instance v0, Ljava/util/ArrayList;

    const/4 v1, 0x2

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V

    iput-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mEnabledProviders:Ljava/util/ArrayList;

    .line 89
    iput-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    .line 436
    new-instance v0, Lcom/htc/android/footprints/service/LocationAgent$1;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/service/LocationAgent$1;-><init>(Lcom/htc/android/footprints/service/LocationAgent;)V

    iput-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationListener:Landroid/location/LocationListener;

    .line 497
    new-instance v0, Lcom/htc/android/footprints/service/LocationAgent$2;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/service/LocationAgent$2;-><init>(Lcom/htc/android/footprints/service/LocationAgent;)V

    iput-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->gpsListener:Landroid/location/GpsStatus$Listener;

    .line 535
    new-instance v0, Lcom/htc/android/footprints/service/LocationAgent$3;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/service/LocationAgent$3;-><init>(Lcom/htc/android/footprints/service/LocationAgent;)V

    iput-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    .line 106
    iput-object p1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mContext:Landroid/content/Context;

    .line 107
    const-string v0, "LocationAgent"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "mContext = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mContext:Landroid/content/Context;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 108
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->init()V

    .line 109
    return-void
.end method

.method static synthetic access$000(Lcom/htc/android/footprints/service/LocationAgent;)Ljava/util/ArrayList;
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mEnabledProviders:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$100(Lcom/htc/android/footprints/service/LocationAgent;)I
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    iget v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    return v0
.end method

.method static synthetic access$1002(Lcom/htc/android/footprints/service/LocationAgent;Z)Z
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 23
    iput-boolean p1, p0, Lcom/htc/android/footprints/service/LocationAgent;->isTrackingAfterResume:Z

    return p1
.end method

.method static synthetic access$102(Lcom/htc/android/footprints/service/LocationAgent;I)I
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 23
    iput p1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    return p1
.end method

.method static synthetic access$1100(Lcom/htc/android/footprints/service/LocationAgent;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 23
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->notifyClient()V

    return-void
.end method

.method static synthetic access$200(Lcom/htc/android/footprints/service/LocationAgent;)Landroid/location/Location;
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    return-object v0
.end method

.method static synthetic access$202(Lcom/htc/android/footprints/service/LocationAgent;Landroid/location/Location;)Landroid/location/Location;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 23
    iput-object p1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    return-object p1
.end method

.method static synthetic access$300(Lcom/htc/android/footprints/service/LocationAgent;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 23
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->removeTimer()V

    return-void
.end method

.method static synthetic access$400(Lcom/htc/android/footprints/service/LocationAgent;)Landroid/location/Location;
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    return-object v0
.end method

.method static synthetic access$402(Lcom/htc/android/footprints/service/LocationAgent;Landroid/location/Location;)Landroid/location/Location;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 23
    iput-object p1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    return-object p1
.end method

.method static synthetic access$500(Lcom/htc/android/footprints/service/LocationAgent;)Lcom/htc/android/footprints/service/LocationAgent$AgentListener;
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    return-object v0
.end method

.method static synthetic access$600(Lcom/htc/android/footprints/service/LocationAgent;)Landroid/location/LocationManager;
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationManager:Landroid/location/LocationManager;

    return-object v0
.end method

.method static synthetic access$700(Lcom/htc/android/footprints/service/LocationAgent;)F
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    iget v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    return v0
.end method

.method static synthetic access$702(Lcom/htc/android/footprints/service/LocationAgent;F)F
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 23
    iput p1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    return p1
.end method

.method static synthetic access$800(Lcom/htc/android/footprints/service/LocationAgent;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    iget-boolean v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->isTimeoutNotify:Z

    return v0
.end method

.method static synthetic access$900(Lcom/htc/android/footprints/service/LocationAgent;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 23
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->startTimer()V

    return-void
.end method

.method private getGpsSignalLevel()I
    .locals 6

    .prologue
    const/high16 v5, 0x41f0

    const/high16 v4, 0x41a0

    const/high16 v3, 0x4120

    const/high16 v2, 0x40a0

    .line 370
    const/4 v0, 0x0

    .line 372
    .local v0, level:I
    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    cmpg-float v1, v1, v2

    if-gez v1, :cond_1

    .line 373
    const/4 v0, 0x0

    .line 384
    :cond_0
    :goto_0
    return v0

    .line 374
    :cond_1
    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    cmpl-float v1, v1, v2

    if-ltz v1, :cond_2

    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    cmpg-float v1, v1, v3

    if-gez v1, :cond_2

    .line 375
    const/4 v0, 0x1

    goto :goto_0

    .line 376
    :cond_2
    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    cmpl-float v1, v1, v3

    if-lez v1, :cond_3

    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    cmpg-float v1, v1, v4

    if-gez v1, :cond_3

    .line 377
    const/4 v0, 0x2

    goto :goto_0

    .line 378
    :cond_3
    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    cmpl-float v1, v1, v4

    if-lez v1, :cond_4

    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    cmpg-float v1, v1, v5

    if-gez v1, :cond_4

    .line 379
    const/4 v0, 0x3

    goto :goto_0

    .line 380
    :cond_4
    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    cmpl-float v1, v1, v5

    if-lez v1, :cond_0

    .line 381
    const/4 v0, 0x4

    goto :goto_0
.end method

.method private init()V
    .locals 3

    .prologue
    .line 112
    const-string v0, "LocationAgent"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "mContext = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mContext:Landroid/content/Context;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 115
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mContext:Landroid/content/Context;

    const-string v1, "location"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/location/LocationManager;

    iput-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationManager:Landroid/location/LocationManager;

    .line 118
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->resetStatus()V

    .line 122
    return-void
.end method

.method public static instance(Landroid/content/Context;)Lcom/htc/android/footprints/service/LocationAgent;
    .locals 1
    .parameter "context"

    .prologue
    .line 99
    sget-object v0, Lcom/htc/android/footprints/service/LocationAgent;->mInstance:Lcom/htc/android/footprints/service/LocationAgent;

    if-nez v0, :cond_0

    .line 100
    new-instance v0, Lcom/htc/android/footprints/service/LocationAgent;

    invoke-direct {v0, p0}, Lcom/htc/android/footprints/service/LocationAgent;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/htc/android/footprints/service/LocationAgent;->mInstance:Lcom/htc/android/footprints/service/LocationAgent;

    .line 102
    :cond_0
    sget-object v0, Lcom/htc/android/footprints/service/LocationAgent;->mInstance:Lcom/htc/android/footprints/service/LocationAgent;

    return-object v0
.end method

.method private isProviderEnabled(Ljava/lang/String;)Z
    .locals 1
    .parameter "provider"

    .prologue
    .line 296
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationManager:Landroid/location/LocationManager;

    invoke-virtual {v0, p1}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method private notifyClient()V
    .locals 11

    .prologue
    const-wide/16 v9, 0x3e8

    const/16 v8, 0x68

    const-wide/16 v3, 0x0

    const-string v7, "LocationAgent"

    .line 388
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    if-eqz v0, :cond_0

    .line 389
    iget v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    packed-switch v0, :pswitch_data_0

    .line 434
    :cond_0
    :goto_0
    :pswitch_0
    return-void

    .line 391
    :pswitch_1
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    iget v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    move-wide v5, v3

    invoke-interface/range {v0 .. v6}, Lcom/htc/android/footprints/service/LocationAgent$AgentListener;->onUpdateStatus(IIDD)V

    .line 392
    const-string v0, "LocationAgent"

    const-string v0, "notify client : MODE_STOP"

    invoke-static {v7, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 396
    :pswitch_2
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->getGpsSignalLevel()I

    move-result v0

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    .line 397
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    iget v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    move-wide v5, v3

    invoke-interface/range {v0 .. v6}, Lcom/htc/android/footprints/service/LocationAgent$AgentListener;->onUpdateStatus(IIDD)V

    .line 398
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, v8, v9, v10}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    .line 399
    const-string v0, "LocationAgent"

    const-string v0, "notify client : MODE_TRACKING"

    invoke-static {v7, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 403
    :pswitch_3
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->getGpsSignalLevel()I

    move-result v0

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    .line 404
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    const/16 v1, 0xb

    iget v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    move-wide v5, v3

    invoke-interface/range {v0 .. v6}, Lcom/htc/android/footprints/service/LocationAgent$AgentListener;->onUpdateStatus(IIDD)V

    .line 405
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, v8, v9, v10}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    .line 406
    const-string v0, "LocationAgent"

    const-string v0, "notify client : MODE_TRACKING (MODE_PAUSE_STANDBY)"

    invoke-static {v7, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 413
    :pswitch_4
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->pause()V

    goto :goto_0

    .line 417
    :pswitch_5
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->getGpsSignalLevel()I

    move-result v0

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    .line 418
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    iget v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    move-wide v5, v3

    invoke-interface/range {v0 .. v6}, Lcom/htc/android/footprints/service/LocationAgent$AgentListener;->onUpdateStatus(IIDD)V

    .line 419
    const-string v0, "LocationAgent"

    const-string v0, "notify client : MODE_TIMEOUT"

    invoke-static {v7, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 423
    :pswitch_6
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    invoke-virtual {v0}, Landroid/location/Location;->getLatitude()D

    move-result-wide v3

    .line 424
    .local v3, lat:D
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    invoke-virtual {v0}, Landroid/location/Location;->getLongitude()D

    move-result-wide v5

    .line 425
    .local v5, lon:D
    const/4 v0, 0x5

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    .line 426
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    iget v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    iget v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurIcon:I

    invoke-interface/range {v0 .. v6}, Lcom/htc/android/footprints/service/LocationAgent$AgentListener;->onUpdateStatus(IIDD)V

    .line 427
    const-string v0, "LocationAgent"

    const-string v0, "notify client : MODE_FIX_GPS"

    invoke-static {v7, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0

    .line 389
    nop

    :pswitch_data_0
    .packed-switch 0xa
        :pswitch_1
        :pswitch_2
        :pswitch_5
        :pswitch_6
        :pswitch_0
        :pswitch_3
        :pswitch_4
    .end packed-switch
.end method

.method private pause()V
    .locals 2

    .prologue
    .line 162
    const-string v0, "LocationAgent"

    const-string v1, "Agent pause"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 164
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    if-eqz v0, :cond_0

    .line 165
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    invoke-interface {v0}, Lcom/htc/android/footprints/service/LocationAgent$AgentListener;->onAgentPause()V

    .line 167
    :cond_0
    return-void
.end method

.method private removeSystemListener()V
    .locals 2

    .prologue
    .line 138
    const-string v0, "LocationAgent"

    const-string v1, "removeSystemListener"

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 140
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationManager:Landroid/location/LocationManager;

    iget-object v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->gpsListener:Landroid/location/GpsStatus$Listener;

    invoke-virtual {v0, v1}, Landroid/location/LocationManager;->removeGpsStatusListener(Landroid/location/GpsStatus$Listener;)V

    .line 141
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationManager:Landroid/location/LocationManager;

    iget-object v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationListener:Landroid/location/LocationListener;

    invoke-virtual {v0, v1}, Landroid/location/LocationManager;->removeUpdates(Landroid/location/LocationListener;)V

    .line 143
    return-void
.end method

.method private removeTimer()V
    .locals 3

    .prologue
    const/16 v2, 0x64

    .line 332
    const-string v0, "LocationAgent"

    const-string v1, "removeTimer"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 333
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, v2}, Landroid/os/Handler;->hasMessages(I)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 334
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, v2}, Landroid/os/Handler;->removeMessages(I)V

    .line 336
    :cond_0
    return-void
.end method

.method private requestGPS()V
    .locals 6

    .prologue
    .line 301
    const-string v0, "LocationAgent"

    const-string v1, "requestGPS"

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 302
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationManager:Landroid/location/LocationManager;

    const-string v1, "gps"

    const-wide/16 v2, 0x0

    const/4 v4, 0x0

    iget-object v5, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationListener:Landroid/location/LocationListener;

    invoke-virtual/range {v0 .. v5}, Landroid/location/LocationManager;->requestLocationUpdates(Ljava/lang/String;JFLandroid/location/LocationListener;)V

    .line 306
    return-void
.end method

.method private requestNetwork()V
    .locals 6

    .prologue
    .line 309
    const-string v0, "LocationAgent"

    const-string v1, "requestNetwork"

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 310
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationManager:Landroid/location/LocationManager;

    const-string v1, "network"

    const-wide/16 v2, 0x0

    const/4 v4, 0x0

    iget-object v5, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationListener:Landroid/location/LocationListener;

    invoke-virtual/range {v0 .. v5}, Landroid/location/LocationManager;->requestLocationUpdates(Ljava/lang/String;JFLandroid/location/LocationListener;)V

    .line 314
    return-void
.end method

.method private resetStatus()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 125
    const-string v0, "LocationAgent"

    const-string v1, "resetStatus"

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 127
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->isTimeoutNotify:Z

    .line 128
    iput-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    .line 129
    iput-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    .line 130
    const/4 v0, 0x0

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mGpsSignal:F

    .line 131
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mEnabledProviders:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 135
    return-void
.end method

.method private setGpsFixListener()V
    .locals 2

    .prologue
    .line 607
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->gpsFixStatus:Lcom/htc/android/footprints/utils/GpsFixStatus;

    new-instance v1, Lcom/htc/android/footprints/service/LocationAgent$4;

    invoke-direct {v1, p0}, Lcom/htc/android/footprints/service/LocationAgent$4;-><init>(Lcom/htc/android/footprints/service/LocationAgent;)V

    invoke-virtual {v0, v1}, Lcom/htc/android/footprints/utils/GpsFixStatus;->setFixListener(Lcom/htc/android/footprints/utils/GpsFixStatus$FixListener;)V

    .line 611
    return-void
.end method

.method private startTimer()V
    .locals 4

    .prologue
    .line 327
    const-string v0, "LocationAgent"

    const-string v1, "startTimer"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 328
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    const/16 v1, 0x64

    iget-wide v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mTimeout:J

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    .line 329
    return-void
.end method


# virtual methods
.method public continueTracking()V
    .locals 4

    .prologue
    const/16 v3, 0x68

    .line 225
    const-string v0, "LocationAgent"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "continueTracking, mCurMode = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 226
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->removeTimer()V

    .line 227
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->startTimer()V

    .line 230
    const/16 v0, 0xb

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    .line 231
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, v3}, Landroid/os/Handler;->hasMessages(I)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 232
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, v3}, Landroid/os/Handler;->removeMessages(I)V

    .line 234
    :cond_0
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->notifyClient()V

    .line 235
    return-void
.end method

.method public enableMyLocation()V
    .locals 11

    .prologue
    const/16 v7, 0xb

    const-string v10, "Couldn\'t get provider "

    const-string v9, ": "

    const-string v8, "LocationAgent"

    .line 238
    const-string v5, "LocationAgent"

    const-string v5, "enableMyLocation, MODE_TRACKING"

    invoke-static {v8, v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 239
    const-string v5, "LocationAgent"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "gps location: "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    iget-object v6, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, ", network location: "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    iget-object v6, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v8, v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 241
    iget v5, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    if-ne v5, v7, :cond_1

    .line 243
    iget-object v5, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    if-eqz v5, :cond_0

    .line 244
    const-string v5, "LocationAgent"

    const-string v5, "enableMyLocation when mCurMode is MODE_TRACKING. but mLocation is not null"

    invoke-static {v8, v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 288
    :cond_0
    :goto_0
    return-void

    .line 249
    :cond_1
    iput v7, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    .line 252
    const/4 v5, 0x0

    iput-object v5, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    iput-object v5, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    .line 255
    iget-object v5, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationManager:Landroid/location/LocationManager;

    iget-object v6, p0, Lcom/htc/android/footprints/service/LocationAgent;->gpsListener:Landroid/location/GpsStatus$Listener;

    invoke-virtual {v5, v6}, Landroid/location/LocationManager;->addGpsStatusListener(Landroid/location/GpsStatus$Listener;)Z

    .line 257
    sget-object v0, Lcom/htc/android/footprints/service/LocationAgent;->PROVIDER_NAMES:[Ljava/lang/String;

    .local v0, arr$:[Ljava/lang/String;
    array-length v3, v0

    .local v3, len$:I
    const/4 v2, 0x0

    .local v2, i$:I
    :goto_1
    if-ge v2, v3, :cond_5

    aget-object v4, v0, v2

    .line 259
    .local v4, name:Ljava/lang/String;
    :try_start_0
    invoke-direct {p0, v4}, Lcom/htc/android/footprints/service/LocationAgent;->isProviderEnabled(Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_2

    .line 257
    :goto_2
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    .line 263
    :cond_2
    iget-object v5, p0, Lcom/htc/android/footprints/service/LocationAgent;->mEnabledProviders:Ljava/util/ArrayList;

    new-instance v6, Lcom/htc/android/footprints/service/LocationAgent$NameAndDate;

    invoke-direct {v6, v4}, Lcom/htc/android/footprints/service/LocationAgent$NameAndDate;-><init>(Ljava/lang/String;)V

    invoke-virtual {v5, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 265
    const-string v5, "gps"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_3

    .line 266
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->requestGPS()V

    .line 268
    :cond_3
    const-string v5, "network"

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_4

    .line 269
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->requestNetwork()V

    .line 275
    :cond_4
    const-string v5, "LocationAgent"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Request updates from "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_1

    goto :goto_2

    .line 276
    :catch_0
    move-exception v5

    move-object v1, v5

    .line 277
    .local v1, e:Ljava/lang/SecurityException;
    const-string v5, "LocationAgent"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "Couldn\'t get provider "

    invoke-virtual {v5, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, ": "

    invoke-virtual {v5, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v1}, Ljava/lang/SecurityException;->getMessage()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v8, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_2

    .line 279
    .end local v1           #e:Ljava/lang/SecurityException;
    :catch_1
    move-exception v5

    move-object v1, v5

    .line 280
    .local v1, e:Ljava/lang/IllegalArgumentException;
    const-string v5, "LocationAgent"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "Couldn\'t get provider "

    invoke-virtual {v5, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, ": "

    invoke-virtual {v5, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v1}, Ljava/lang/IllegalArgumentException;->getMessage()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v8, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_2

    .line 285
    .end local v1           #e:Ljava/lang/IllegalArgumentException;
    .end local v4           #name:Ljava/lang/String;
    :cond_5
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->startTimer()V

    .line 287
    iget-object v5, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    const/16 v6, 0x68

    const-wide/16 v7, 0x3e8

    invoke-virtual {v5, v6, v7, v8}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    goto/16 :goto_0
.end method

.method public free()V
    .locals 2

    .prologue
    .line 146
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    if-eq v0, v1, :cond_0

    .line 147
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Looper;->quit()V

    .line 150
    :cond_0
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    .line 151
    return-void
.end method

.method public getFixGpsCeoPoint()Lcom/google/android/maps/GeoPoint;
    .locals 6

    .prologue
    const-wide v4, 0x412e848000000000L

    .line 351
    const/4 v0, 0x0

    .line 353
    .local v0, gp:Lcom/google/android/maps/GeoPoint;
    iget-object v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    if-eqz v1, :cond_0

    .line 354
    new-instance v0, Lcom/google/android/maps/GeoPoint;

    .end local v0           #gp:Lcom/google/android/maps/GeoPoint;
    iget-object v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    invoke-virtual {v1}, Landroid/location/Location;->getLatitude()D

    move-result-wide v1

    mul-double/2addr v1, v4

    double-to-int v1, v1

    iget-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    invoke-virtual {v2}, Landroid/location/Location;->getLongitude()D

    move-result-wide v2

    mul-double/2addr v2, v4

    double-to-int v2, v2

    invoke-direct {v0, v1, v2}, Lcom/google/android/maps/GeoPoint;-><init>(II)V

    .line 357
    .restart local v0       #gp:Lcom/google/android/maps/GeoPoint;
    :cond_0
    return-object v0
.end method

.method public getFixGpsLocation()Landroid/location/Location;
    .locals 1

    .prologue
    .line 343
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocation:Landroid/location/Location;

    return-object v0
.end method

.method public getFixNetworkGeoPoint()Lcom/google/android/maps/GeoPoint;
    .locals 6

    .prologue
    const-wide v4, 0x412e848000000000L

    .line 361
    const/4 v0, 0x0

    .line 362
    .local v0, gp:Lcom/google/android/maps/GeoPoint;
    iget-object v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    if-eqz v1, :cond_0

    .line 363
    new-instance v0, Lcom/google/android/maps/GeoPoint;

    .end local v0           #gp:Lcom/google/android/maps/GeoPoint;
    iget-object v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    invoke-virtual {v1}, Landroid/location/Location;->getLatitude()D

    move-result-wide v1

    mul-double/2addr v1, v4

    double-to-int v1, v1

    iget-object v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    invoke-virtual {v2}, Landroid/location/Location;->getLongitude()D

    move-result-wide v2

    mul-double/2addr v2, v4

    double-to-int v2, v2

    invoke-direct {v0, v1, v2}, Lcom/google/android/maps/GeoPoint;-><init>(II)V

    .line 366
    .restart local v0       #gp:Lcom/google/android/maps/GeoPoint;
    :cond_0
    return-object v0
.end method

.method public getFixNetworkLocation()Landroid/location/Location;
    .locals 1

    .prologue
    .line 347
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mLocationNetwork:Landroid/location/Location;

    return-object v0
.end method

.method public isTrackingGps()Z
    .locals 3

    .prologue
    .line 187
    const-string v0, "LocationAgent"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "isTrackingGps: mCurMode = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 188
    iget v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    const/16 v1, 0xb

    if-ne v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public isTrackingTimeout()Z
    .locals 3

    .prologue
    .line 192
    const-string v0, "LocationAgent"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "isTrackingTimeout: mCurMode = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 193
    iget v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    const/16 v1, 0xc

    if-ne v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public resume()V
    .locals 3

    .prologue
    const-string v2, "LocationAgent"

    .line 170
    const-string v0, "LocationAgent"

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "Agent resume, isTrackingAfterResume = "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-boolean v1, p0, Lcom/htc/android/footprints/service/LocationAgent;->isTrackingAfterResume:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v2, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 172
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    const/16 v1, 0x69

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 174
    iget v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    const/16 v1, 0xf

    if-ne v0, v1, :cond_0

    .line 175
    const/16 v0, 0xb

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    .line 176
    const-string v0, "LocationAgent"

    const-string v0, "resume, mCurMode = MODE_TRACKING"

    invoke-static {v2, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 179
    :cond_0
    iget-boolean v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->isTrackingAfterResume:Z

    if-eqz v0, :cond_1

    .line 180
    invoke-virtual {p0}, Lcom/htc/android/footprints/service/LocationAgent;->enableMyLocation()V

    .line 183
    :cond_1
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->isTrackingAfterResume:Z

    .line 184
    return-void
.end method

.method public setAgentListener(Lcom/htc/android/footprints/service/LocationAgent$AgentListener;)V
    .locals 0
    .parameter "listener"

    .prologue
    .line 339
    iput-object p1, p0, Lcom/htc/android/footprints/service/LocationAgent;->mClientListener:Lcom/htc/android/footprints/service/LocationAgent$AgentListener;

    .line 340
    return-void
.end method

.method public setTimeout(Ljava/lang/Long;)V
    .locals 2
    .parameter "timer"

    .prologue
    .line 321
    invoke-virtual {p1}, Ljava/lang/Long;->longValue()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mTimeout:J

    .line 322
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->removeTimer()V

    .line 323
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->startTimer()V

    .line 324
    return-void
.end method

.method public setTimeoutNotify(Z)V
    .locals 0
    .parameter "notify"

    .prologue
    .line 317
    iput-boolean p1, p0, Lcom/htc/android/footprints/service/LocationAgent;->isTimeoutNotify:Z

    .line 318
    return-void
.end method

.method public shutdownAgent()V
    .locals 2

    .prologue
    .line 197
    const-string v0, "LocationAgent"

    const-string v1, "shutdownAgent, MODE_STOP"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 198
    const/16 v0, 0xa

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    .line 199
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    const/16 v1, 0x68

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 200
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->removeTimer()V

    .line 201
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->resetStatus()V

    .line 202
    const-wide/32 v0, 0x1d4c0

    iput-wide v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mTimeout:J

    .line 203
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->removeSystemListener()V

    .line 204
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->notifyClient()V

    .line 205
    return-void
.end method

.method public stopTracking()V
    .locals 2

    .prologue
    .line 208
    const-string v0, "LocationAgent"

    const-string v1, "stopTracking, MODE_STOP"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 209
    const/16 v0, 0xa

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    .line 210
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->removeTimer()V

    .line 211
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->resetStatus()V

    .line 212
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->removeSystemListener()V

    .line 213
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->notifyClient()V

    .line 214
    return-void
.end method

.method public stopTrackingWithoutNotify()V
    .locals 2

    .prologue
    .line 217
    const-string v0, "LocationAgent"

    const-string v1, "stopTrackingWithoutNotify, MODE_STOP"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 218
    const/16 v0, 0xa

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    .line 219
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->removeTimer()V

    .line 220
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->resetStatus()V

    .line 221
    invoke-direct {p0}, Lcom/htc/android/footprints/service/LocationAgent;->removeSystemListener()V

    .line 222
    return-void
.end method

.method public waitForPause()V
    .locals 4

    .prologue
    .line 154
    iget v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    const/16 v1, 0xb

    if-ne v0, v1, :cond_0

    .line 155
    const/16 v0, 0xf

    iput v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mCurMode:I

    .line 156
    iget-object v0, p0, Lcom/htc/android/footprints/service/LocationAgent;->mHandler:Landroid/os/Handler;

    const/16 v1, 0x69

    const-wide/16 v2, 0x1388

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    .line 157
    const-string v0, "LocationAgent"

    const-string v1, "waitForPause, mCurMode = MODE_PAUSE_STANDBY"

    invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    .line 159
    :cond_0
    return-void
.end method
